/*!
 * tykhome - soft.js
 * Author tykhome <yongketian@gmail.com>
 */

/**
 * Module dependencies.
 */
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.ObjectId;

var SoftSchema = new Schema({
	title: { type: String },
	abstract: { type: String },
	author_id: { type: ObjectId },
	content: { type: String },
	// tags: { type: Array },
	html: { type: String },
	create_at: { type: Date, default: Date.now },
	update_at: { type: Date, default: Date.now }
});

SoftSchema.index({create_at: -1});
SoftSchema.index({author_id: 1, create_at: -1});

mongoose.model('Soft', SoftSchema);
